﻿using Common.Utils;
using Game.Logic;
using NetFramework;
using USClientKernel;
using USClientKernel.Template;

namespace Game
{
    public class ClientKernel : Singleton<ClientKernel>, IClientKernel
    {
        private GameController m_gameController;
        public GameController GameController { get => m_gameController; private set => m_gameController = value; }

        // 初始化
        protected override void Init()
        {
            XLuaManager.Instance.ReloadMain();
            m_gameController = new GameController();
        }

        // 开始函数
        public void Start()
        {
            m_gameController.Start();
        }

        // 更新函数
        public void Update()
        {
            NetworkManager.Instance.OnUpdate();
        }

        // 固定更新更新
        public void FixedUpdate()
        {
            NetworkManager.Instance.OnFixedUpdate();
        }

        // 退出函数
        public void Exit()
        {
            NetworkManager.Instance.OnExit();
        }
    }
}
